import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('https://ecshop.test2.shopex123.com/')

# 获取免费注册的元素,然后点击
reg = driver.find_element(By.XPATH, '//*[@id="ECS_MEMBERZONE"]/a[2]').click()

# 找到用户名的元素,填写用户名
username = driver.find_element(By.XPATH, '//*[@id="username"]')
username.send_keys('wuxn')

# 找到邮箱,元素,填写
ec_email = driver.find_element(By.XPATH, '//*[@id="email"]')
ec_email.send_keys('291700430@qq.com')

# 找到密码的元素,填写
password = driver.find_element(By.XPATH, '//*[@id="password1"]')
password.send_keys('0527wu')

# 找到确认密码的元素
re_password = driver.find_element(By.XPATH, '//*[@id="confirm_password"]')
re_password.send_keys('0527wu')

# 找到注册按钮并点击
btn = driver.find_element(By.XPATH, '//*[@id="main"]/div[2]/form/div[9]/input[3]').click()

driver.quit()


